package com.quzitech.efest.view;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;

import com.quzitech.efest.R;
import com.quzitech.efest.handle.IDialogGuide;
import com.quzitech.efest.handle.IDiaolgHandler;
import com.quzitech.efest.utils.imageloader.ImageLoader;

public class MyDialogGuide {
	Context context;
	IDialogGuide handler;
	Dialog dialog;
	public boolean flag = false;
	ImageView iv_dialog_guide;

	/**
	 * init the dialog
	 * 
	 * @return
	 */
	public MyDialogGuide(Context con) {
		this.context = con;
		dialog = new Dialog(context, R.style.DialogGuide);
		dialog.setCanceledOnTouchOutside(false);
		dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
		dialog.setCancelable(false);
		dialog.setContentView(R.layout.view_dialog_guide);
		iv_dialog_guide = (ImageView) dialog.findViewById(R.id.iv_dialog_guide);
		iv_dialog_guide.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {

				handler.clickpic();

			}
		});

	}

	public void setImageIcon(int resid) {
		this.iv_dialog_guide.setBackgroundResource(resid);

		// this.iv_dialog_guide.setVisibility(View.VISIBLE);
		// bitmapUtils = new BitmapUtils(context);
		// bitmapUtils.display(iv_dialog_guide, path);
	}

	public void setDialogGuideHandler(IDialogGuide handler) {
		this.handler = handler;
	}

	public void show() {
		dialog.show();
	}

	public void hide() {
		dialog.hide();
	}

	public void dismiss() {
		dialog.dismiss();
	}
}